<?php
session_start();
$currentUser = isset($_SESSION["user"])?$_SESSION["user"]:null;

$theme = isset($_GET["theme"])?$_GET["theme"]:"";
if(!$theme){
  $theme = isset($_COOKIE["theme"])?$_COOKIE["theme"]:null;
}else{
  setcookie("theme",$theme);
}
if(!$theme) $theme = "default";

function makePageUrl($pageIndex){
    $querystring="pageIndex=$pageIndex";
    foreach($_GET as $k =>$v){
        if($k==="pageIndex"){
            continue;
        }
        $querystring .= "&$k=$v";
    }
    return $querystring;
}


